Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding hermes to e2e tests. #3408

Merged
merged 24 commits into from
Jun 7, 2023

Conversation

DimitrisJim
Copy link
Contributor

@DimitrisJim DimitrisJim commented Apr 4, 2023

Description

closes: #3315

Commit Message / Changelog Entry

feat: integrating hermes in our e2e tests

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@DimitrisJim DimitrisJim linked an issue Apr 4, 2023 that may be closed by this pull request
3 tasks
@@ -50,7 +50,7 @@ on:
relayer-type:
description: "The type of relayer to use"
required: false
default: "rly"
default: "hermes"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily, for checking test results

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we be reverting this before merging?

type: string
relayer-tag:
description: "The tag to use for the relayer"
required: false
default: "" # the tests themselves will choose a sensible default when unset.
default: "1.4.0" # the tests themselves will choose a sensible default when unset.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, temporarily.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also reverting this

@DimitrisJim
Copy link
Contributor Author

DimitrisJim commented Apr 11, 2023

Pending upstream merge of the changes in interchaintesting strangelove-ventures/interchaintest#493 and a bump of the cosmos-sdk to 0.47.1 (since interchaintesting bumped that recently!) ref #3459

@DimitrisJim DimitrisJim force-pushed the jim/3315-integrate-hermes-into-our-e2e-tests branch from 2831435 to 3fb3004 Compare April 26, 2023 20:40
@DimitrisJim DimitrisJim force-pushed the jim/3315-integrate-hermes-into-our-e2e-tests branch from ab3f9b5 to 77bc38d Compare May 15, 2023 08:45
@DimitrisJim
Copy link
Contributor Author

So, the biggest changes here are basically the need to add the following after the hermes relayer starts:

s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA, chainB), "failed to wait for blocks")

it appears as if some time is always required before hermes is able to see that packets have been relayed after starting, one explanation for this is possibly that its startup time is slower than that for rly.

I think it shouldn't be too hard to add the previous snippet in s.StartRelayer and discriminate based on relayer.

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Happy to approve, just curious if we can figure out a way to reduce diffs and hopefully decrease the time spent debugging missing wait commands?

cosmosRelayerUser = "100:1000" // docker run -it --rm --entrypoint echo ghcr.io/cosmos/relayer "$(id -u):$(id -g)"
hermesRelayerRepository = "ghcr.io/informalsystems/hermes"
hermesRelayerUser = "1000:1000"
rlyRelayerRepository = "damiannolan/rly" //"ghcr.io/cosmos/relayer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be changed back?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, these are used when creating the relayer in newHermesRelayer:

customImageOption := relayer.CustomDockerImage(hermesRelayerRepository, tag, hermesRelayerUser)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I mean't the damiannolan/rly string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, right, that's pending on cosmos/relayer#1102

hermesRelayerRepository = "ghcr.io/informalsystems/hermes"
hermesRelayerUser = "1000:1000"
rlyRelayerRepository = "damiannolan/rly" //"ghcr.io/cosmos/relayer"
rlyRelayerUser = "100:1000" // docker run -it --rm --entrypoint echo ghcr.io/cosmos/relayer "$(id -u):$(id -g)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a public function for this now, but can't remember

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are

Copy link
Contributor Author

@DimitrisJim DimitrisJim May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looked into this. Using a custom image (like we currently do) doesn't use the defaults. Can't use the defaults for rly since we're based on Damian's forked image, can't use the default for hermes since interchaintest hasn't updated their registry url (still points to docker rather than ghcr + is on version 1.2.0). I'll probably open a PR for the second case on interchaintest and we can drop both consts for hermes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, once we switch off damian's image (probably after v7.1 release) then we can move to the defaults. Is there an issue to track this work? If not, maybe we can open an issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not, maybe we can open an issue

yup! done with #3615

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: hermes image/tag updates done strangelove-ventures/interchaintest#571

e2e/tests/interchain_accounts/base_test.go Outdated Show resolved Hide resolved
@DimitrisJim DimitrisJim force-pushed the jim/3315-integrate-hermes-into-our-e2e-tests branch from 33f17ed to 77bc38d Compare May 23, 2023 11:36
@DimitrisJim DimitrisJim force-pushed the jim/3315-integrate-hermes-into-our-e2e-tests branch from e34b306 to 7931429 Compare June 1, 2023 07:35
@DimitrisJim DimitrisJim force-pushed the jim/3315-integrate-hermes-into-our-e2e-tests branch from 7931429 to 777fced Compare June 1, 2023 07:49
@seanchen1991
Copy link

Hey guys, just want to remind you all that Hermes v1.5 is out. It might be worth updating to the latest version of Hermes in your tests 🙂

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @DimitrisJim!! 🎉

e2e/testsuite/testsuite.go Outdated Show resolved Hide resolved
@DimitrisJim
Copy link
Contributor Author

thanks for the heads up @seanchen1991 I'll bump it now since we hardcode it atm in our tests until we can update to the latest interchaintest version (which should also be bumped!)

@DimitrisJim DimitrisJim force-pushed the jim/3315-integrate-hermes-into-our-e2e-tests branch from 590046d to 07b76fb Compare June 1, 2023 17:12
@DimitrisJim
Copy link
Contributor Author

DimitrisJim commented Jun 6, 2023

Think this should be gtg (will rollback temporary changes to workflow files when necessary). Waiting for ten blocks does suffice for hermes in this case.

Re: bumping to 1.5. Doing this results in the conf for hermes not being found. When I bumped into this case previously, Cian helped out by mentioning it might be a uid/gid issue, which it was. Tweaking that now doesn't seem to have an effect.

I think its fine if we punt this to a later point. Hopefully, we'll be able to sync up with latest interchaintest (which defines the tag/version for hermes so we don't need to redefine here) for which I'll try to bump the version.

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

If we have all tests passing with hermes (or at least all the ones we know should be passing)

I would be happy to merge this once we revert to the go relayer as default and then we can discuss what we want to do re hermes/rly for our PRs/compatibility testing etc in a future discussion1

thanks for all the work on this!

The LOC does not reflect the effort you put in to get this all working 🥇

@@ -128,7 +128,7 @@ func (s *E2ETestSuite) SetupChainsRelayerAndChannel(ctx context.Context, channel
}
})
// wait for relayer to start.
time.Sleep(time.Second * 10)
s.Require().NoError(test.WaitForBlocks(ctx, 10, chainA, chainB), "failed to wait for blocks")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what we will be able to remove in the future right?

Copy link
Contributor Author

@DimitrisJim DimitrisJim Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering this was in place with rly (only in sleep form) maybe we'll always need to give relayers some time to get up and running. Ideally, we should be able to drop this to 5 blocks (bumped it to 10 for hermes since 5 resulted in old familiar errors indicating that it needed more time).

@@ -50,7 +50,7 @@ on:
relayer-type:
description: "The type of relayer to use"
required: false
default: "rly"
default: "hermes"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we be reverting this before merging?

type: string
relayer-tag:
description: "The tag to use for the relayer"
required: false
default: "" # the tests themselves will choose a sensible default when unset.
default: "1.4.0" # the tests themselves will choose a sensible default when unset.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also reverting this

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes ACK

If we have all tests passing with hermes (or at least all the ones we know should be passing)

I would be happy to merge this once we revert to the go relayer as default and then we can discuss what we want to do re hermes/rly for our PRs/compatibility testing etc in a future discussion1

thanks for all the work on this!

The LOC does not reflect the effort you put in to get this all working 🥇

@DimitrisJim DimitrisJim merged commit 0b31671 into main Jun 7, 2023
@DimitrisJim DimitrisJim deleted the jim/3315-integrate-hermes-into-our-e2e-tests branch June 7, 2023 11:28
@DimitrisJim DimitrisJim mentioned this pull request Jun 12, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Hermes into our E2E tests
5 participants